cmake_minimum_required(VERSION 3.8)
project(hardware_driver)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

aux_source_directory(src SRC_FILES)
aux_source_directory(src SRC_IMU_FILES)
message(STATUS "possible src files are as following:")
message(STATUS ${SRC_FILES})
find_package(ament_cmake REQUIRED)

add_library(${PROJECT_NAME} SHARED ${SRC_FILES} ${SRC_IMU_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC include)

install(TARGETS ${PROJECT_NAME}
  LIBRARY DESTINATION lib
)

install(DIRECTORY include/ DESTINATION include)

ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})

ament_package()
